<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<link rel="stylesheet" href="../../assets/css/layui.css">
	<link rel="stylesheet" href="../../assets/css/view.css"/>
	<title></title>
</head>
	<body class="layui-view-body">
	<div class="layui-content">
		<div class="layui-row">
			<div class="layui-card">
				<div class="layui-card-header">录入用户</div>
				<form id="form" class="layui-form layui-card-body" action="">
					<div class="layui-form-item">
						<label class="layui-form-label">姓名</label>
						<div class="layui-input-block">
							<input type="text" name="code" required  lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">手机号码</label>
						<div class="layui-input-block">
							<input type="text" name="code" required  lay-verify="required" placeholder="请输入手机号码" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">身份证号</label>
						<div class="layui-input-block">
							<input type="text" name="username" required  lay-verify="required" placeholder="请输入身份证号" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">密码</label>
						<div class="layui-input-block">
							<input type="text" name="phonenumber" required  lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<button class="layui-btn layui-btn-blue" lay-submit lay-filter="formDemo">立即提交</button>
							<button type="reset" class="layui-btn layui-btn-primary">重置</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
		<script src="../../assets/layui.all.js"></script>
		<script src="../../qrcode/jquery2.1.4.js"></script>
		<script src="../../layer/layer.js"></script>
		<script>
			var form = layui.form
					,layer = layui.layer;
		</script>
		<script>
			$(function () {
				$("#form").submit(function () {
					var windowId = layer.load();
					var username = $("input:eq(0)").val();
					var userphone = $("input:eq(1)").val();
					var idcard = $("input:eq(2)").val();
					var password = $("input:eq(3)").val();
					$.post(
							"insert.do",
							{
								username:username,
								userphone:userphone,
								idcard:idcard,
								password:password
							},
							function (data) {
								layer.close(windowId);
								layer.msg(data.result);
								if (data.status == 0){
									$("input").val("");
								}else {

								}
							});
					return false;
				});
			});
		</script>
	</body>
</html>